﻿<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <link href="../Plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet" />
    <link href="../zui/lib/bootstrap/css/bootstrap.css" rel="stylesheet" />
    <link href="../zui/css/font-awesome.min.css" rel="stylesheet" />
    <link href="../zui/css/font-awesome.min.css" rel="stylesheet" />
    <link href="../zui/css/zui.min.css" rel="stylesheet" />
    <link href="../zui/lib/layer/skin/default/layer.css" rel="stylesheet" />
    <link href="../zui/lib/swiper/css/swiper.min.css" rel="stylesheet" />
    <link href="../Plugins/sweetalert/sweetalert.css" rel="stylesheet" />
    <link href="../Plugins/jquery-step/jquery.steps.css" rel="stylesheet" />
    <link href="../zui/css/app.css" rel="stylesheet" />
    <title></title>
    <style type="text/css">
        .form-control {
            height: 40px;
            line-height: 40px;
            font-size: 16px !important;
            padding-left: 10px !important;
        }

        .btn {
            height: 40px;
            font-size: 15px !important;
        }

        body {
            font-size: 16px !important;
        }

        html, body {
            position: relative;
            height: 100%;
        }

        body {
            background: #fff;
            font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
            font-size: 14px;
            color: #000;
            margin: 0;
            padding: 0;
        }
    </style>
</head>
<body>
    <div class="container" style="padding-left:0px !important;max-width:870px!important; width:870px">
        <div class="row" style="margin-bottom:10px;">
            <div class="col-md-6">
                <div class="input-group">
                    <div class="input-control search-box search-box-circle has-icon-left has-icon-right search-example" id="searchboxExample">
                        <input id="inputSearchExample3" type="search" class="form-control search-input numkeyboard" placeholder="搜索">

                    </div>
                    <span class="input-group-btn">
                        <button class="btn btn-primary" id="search-btn" type="button">搜索</button>
                    </span>
                </div>
            </div>
        </div>
        <div style="height:280px !important; overflow-y:scroll">


            <table class="table table-bordered" >
                <thead>
                    <tr >
                        <th style="text-align: center">试验时间</th>
                        <th style="text-align: center">试验材料</th>
                        <th style="text-align: center">试验类型</th>
                        <th style="text-align: center">试验人</th>
                        <th style="text-align: center">操作</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>


        </div>
        <div class="shiyan-footer" style="position:fixed; bottom:0px">
            <button style="height:50px;float:left;margin-right:5px;" class="btn btn-default btn-lg home-btn" type="button">返回主菜单</button>
        </div>
    </div>

    <script src="../zui/lib/jquery/jquery.js"></script>
    <script src="../Plugins/jquery-ui/jquery-ui.min.js"></script>
    <script src="../zui/lib/bootstrap/js/bootstrap.min.js"></script>
    <script src="../zui/lib/layer/layer.js"></script>
    <script src="../zui/lib/swiper/js/swiper.min.js"></script>
    <script src="../Plugins/sweetalert/sweetalert.min.js"></script>
    <script src="../Plugins/jquery-step/jquery.steps.min.js"></script>
    <script src="../static/jquery.flot.js"></script>
    <script src="../zui/js/utils.js"></script>
    <script src="../zui/js/app.js"></script>
    <script type="text/javascript">

        function go(id) {
            location.href = "ReportInfo.html?experimentId=" + id;
        }
        $(function () {
            AjaxGet("正在获取列表数据...", "getExperimentList",
                {
                    searchValue: ''
                }, function (res) {
                    var eList = JSON.parse(res).data;
                    bindList(eList);
                });


            $(".home-btn").click(function () {
                $("#content-frame", parent.document).attr("src", "Menu.html");
                $("#menu-title", parent.document).removeClass().addClass("fa fa-home").text(" 功能菜单");
                $("#userinfo-btn", parent.document).removeClass("disabled");

            });
            $("#search-btn").click(function () {
                var eList = JSON.parse(top.dataOpera.getExperimentList($(".search-input").val())).data;
                bindList(eList);
            });

        })
        function getEType(type) {
            if (type == 1) {
                return "阶段一试验";
            }
            else if (type == 2) {
                return "阶段二试验";
            }

        }
        function bindList(eList) {
            var eStr = "";
            var obj = JSON.parse(sessionStorage.LoginUser);
            $(eList).each(function (index, el) {
                if (obj.user_role != 1 && obj.user_name != eList[index].experiment_user_name) {
                    return false;
                }
               eStr += '<tr style="text-align: center;"><td style="line-height: 40px;">' + eList[index].start_time + '</td>';
                eStr += '<td style="line-height: 40px;">' + eList[index].material_name + '</td>';
                eStr += '<td style="line-height: 40px;">' + getEType(eList[index].experiment_type) + '</td>';
                eStr += '<td style="line-height: 40px;">' + eList[index].experiment_user_name + '</td>';
                eStr += '<td><button  style="height: 40px!important ;line-height: 15px!important;width: 80px!important;" class="btn btn-default view"  val="' + eList[index].experiment_id + '" type="button">查看试验</button></td></tr>';

            });
            $(".table tbody").html(eStr);
            $(".view").click(function () {
                location.href = "ReportInfo.html?experimentId=" + $(this).attr("val");
            });
        }
    </script>
</body>
</html>